IF exists(SELECT * FROM dbo.sysobjects WHERE name='Del_vulBeslis' AND xtype='P') 
BEGIN
	DROP PROCEDURE Del_vulBeslis
END
GO

CREATE    procedure Del_vulBeslis
as 
insert into Del_beslis(inschrijvingsNr)
select l.inschrijvingsNr
from leerlingen..leerlingen as l
left join Del_beslis as d
on l.inschrijvingsNr=d.inschrijvingsNr
where (d.inschrijvingsNr is null) 
and l.klas <>'weg'